/*
 * @Author: juneChen && junechen_0606@163.com
 * @Date: 2023-06-02 15:45:53
 * @LastEditors: juneChen && juneswoole@163.com
 * @LastEditTime: 2023-09-22 15:05:11
 * @Description: 财务相关 数据字典
 * 
 */

export default {
    namespaced: true,
    state: {
        // 订单状态
        orderStatus: [
            {
                value: 'Unpaid',
                label: "未支付",
                color: 'orange'
            },{
                value: 'Havepaid',
                label: "已支付",
                color: 'green'
            },
            {
                value: 'Cancelled',
                label: "已取消",
                color: 'red'
            }
        ],
        // 订单类型
        orderType: [
            {
                value: 'Purchase',
                label: "购买",
            },{
                value: 'Renewal',
                label: "续费",
            },
            {
                value: 'AutomaticRenewal',
                label: "自动续费",
            }
        ],
        // 产品
        products: [
            {
                value: 'proxyIp',
                label: "代理IP",
            }
        ],
        // 订单支付方式
        modePayment: [
            {
                value: 'Balance',
                label: "余额",
            },{
                value: 'Credit',
                label: "信用额",
            },
            {
                value: 'Alipay',
                label: "支付宝",
            },
            {
                value: 'Wechat',
                label: "微信",
            },
            {
                value: 'Remittance',
                label: "转账汇款",
            }
        ],
        // 账单分类
        billClassify: [
            {
                value: 'Virtual',
                label: "虚拟",
            },{
                value: 'Consumption',
                label: "消费",
            },
            {
                value: 'Topup',
                label: "充值",
            },
            {
                value: 'Refund',
                label: "退款",
            },
            {
                value: 'Bkge',
                label: "佣金",
            },
            {
                value: 'Withdraw',
                label: "提现",
            },
            {
                value: 'HandlingCharge',
                label: "手续费",
            },
            {
                value: 'Repayment',
                label: "还款",
            }
        ],
        rechargeResults: [
            {
                value: 'Unpaid',
                label: '待支付'
            },
            {
                value: 'Havepaid',
                label: '已支付'
            },
            {
                value: 'Cancel',
                label: '已取消'
            },
            {
                value: 'Expiration',
                label: '超时取消'
            },
        ]
    },
    getters: {
        financeStateLabel : (state) => (name,value) => {
            var label = "";
            state[name].forEach(element => {
                if(element.value == value){
                    label = element.label;
                }
            });
            return label;
        }
    }
}